package net.neptech.listener;

import lombok.extern.slf4j.Slf4j;
import net.neptech.model.dto.node.Node;
import net.neptech.util.ReflectionsCache;
import org.reflections.Reflections;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author Saya
 * @Date 2025/8/25 02:42
 * @Description TODO
 **/
@Component
@Slf4j
public class ApplicationStartUpListener implements ApplicationListener<ApplicationReadyEvent> {
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        String packageName = Node.class.getPackage().getName();
        Reflections reflections = new Reflections(packageName);
        ReflectionsCache.setReflections(reflections);
        log.info("应用启动完成");
    }
}
